Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: use Python Environment Tools for interpreter discovery #5897

Merged
merged 56 commits into from
Jan 31, 2025

Conversation

isabelizimm
Copy link
Contributor

@isabelizimm isabelizimm commented Jan 7, 2025

Release Notes

New Features

Bug Fixes

  • N/A

QA Notes

Should be able to locate interpreters/start up Python runtimes with setting "python.locator": "native"


TODO

  • re-enable native locator tests
  • add steps into build CI

Copy link

github-actions bot commented Jan 7, 2025

E2E Tests 🚀
This PR will run tests tagged with: @:critical

readme  valid tags

@@ -689,7 +689,7 @@
"type": "string"
},
"python.locator": {
"default": "js",
"default": "native",
Copy link
Contributor Author

@isabelizimm isabelizimm Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, the rust locator is considered experimental and is opt-in only for upstream. I've swapped it for testing purposes, but we'll want to decide what we want as the default. I've played around with it locally, and it seems to be finding everything and is MUCH FASTER, eg, 1-3 seconds to find my 80+ envs. We should do a bit more robust testing before deciding though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had the same experience. We could leave the default as js when we merge to main so that it's optional for the Feb release, and make it the default on main for devs to test during Feb in preparation for the Mar release?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! Once this is merged and we have a build, I can make a discussion post asking for people to opt-in for more feedback 🕺

python-version: 3.8
cache: 'pip'
cache-dependency-path: |
extensions/positron-python/requirements.txt
Copy link
Contributor Author

@isabelizimm isabelizimm Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way to add a working directory for files in .github/actions/? It doesn't look like the way we set it in the Python CI works in this directory.

defaults:
run:
working-directory: 'extensions/positron-python'

@isabelizimm isabelizimm marked this pull request as ready for review January 28, 2025 21:06
seeM
seeM previously approved these changes Jan 29, 2025
Copy link
Contributor

@seeM seeM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @isabelizimm! I checked out the branch, ran npm install, then tested interpreter discovery in a dev build. It seems to work well and is much faster.

Looks good to merge once CI is green and we've decided on the default behavior.

@@ -689,7 +689,7 @@
"type": "string"
},
"python.locator": {
"default": "js",
"default": "native",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had the same experience. We could leave the default as js when we merge to main so that it's optional for the Feb release, and make it the default on main for devs to test during Feb in preparation for the Mar release?

austin3dickey
austin3dickey previously approved these changes Jan 29, 2025
Copy link
Contributor

@austin3dickey austin3dickey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, LGTM! I only have 5 interpreters and it's probably about the same speed. So that's another good data point!

.github/workflows/positron-python-ci.yml Show resolved Hide resolved
await app.workbench.interpreter.selectInterpreter('Python', desiredPython);
await app.workbench.interpreter.verifyInterpreterIsSelected(desiredPython);
await app.workbench.interpreter.verifyInterpreterIsRunning(desiredPython);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simple!

@isabelizimm isabelizimm dismissed stale reviews from austin3dickey and seeM via 0ad2fb4 January 30, 2025 19:42
@isabelizimm
Copy link
Contributor Author

isabelizimm commented Jan 31, 2025

After fighting with extension smoke tests, I swapped the default back to js and all is green. These smoke failures appear to stem from the fact that the smoke tests generate a vsix, move things into a temp directory, clone Positron, then re-build the extension; it looks like at some point in time, the temp directory either doesn't have permission or can't reach into the pet.

We've tried this out in builds, and it does not seem to have the same errors. I feel pretty confident this is a temp dir weirdness since the e2e tests are passing. It looks like upstream has moved to an entirely different testing strategy for the smoke tests, which we might want to look into.

@isabelizimm isabelizimm merged commit 21a4d6b into main Jan 31, 2025
28 checks passed
@isabelizimm isabelizimm deleted the pet-python branch January 31, 2025 19:57
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants